
#ifndef LCD_H
#define LCD_H

#include "main.h"

//#define _DDR_RS _DDRB.bit2
//#define _DDR_RW _DDRB.bit1
//#define _DDR_ENA _DDRB.bit0
//#define CMD_PRT _PORTB
//#define RS _PORTB.bit2
//#define RW _PORTB.bit1
//#define ENA _PORTB.bit0
//
//#define _DDR_DT0 _DDRC.bit3
//#define _DDR_DT1 _DDRC.bit2
//#define _DDR_DT2 _DDRC.bit1
//#define _DDR_DT3 _DDRC.bit0
//#define DTA_PRT _PORTC
//#define DTA0 _PORTC.bit3
//#define DTA1 _PORTC.bit2
//#define DTA2 _PORTC.bit1
//#define DTA3 _PORTC.bit0


#define lcd_wait _delay_us(150);

void lcd_on();
void lcd_off();
void lcd_setio();
void lcd_reset();

void lcd_strobe();
void lcd_write ( unsigned char bus );
void lcd_clear();
void lcd_home();
void lcd_init();
void lcd_delay();
void lcd_setpos(unsigned char pos);
void lcd_sign(unsigned char sign);
void lcd_print(char *text);

void lcd_def(u8 num, u8 a, u8 b, u8 c, u8 d, u8 e, u8 f, u8 g, u8 h);
void lcd_def2(u8 num, char *tab);

#define LCD_VCC_ON	{ PORTC |= (1 << 5); DDRC = 0xFF; }
#define LCD_VCC_OFF { DDRC = 0x01; PORTC = 0x01; }				// led_alarm PC.0



#endif
